# WebRTC HTTPS 快速检查脚本
# 快速验证关键 HTTPS 配置

Write-Host "🔍 WebRTC HTTPS 快速检查..." -ForegroundColor Blue

$issues = @()

# 检查规则文档
if (!(Test-Path "WEBRTC_HTTPS_RULES.md")) {
    $issues += "缺失 WEBRTC_HTTPS_RULES.md"
}

# 检查证书
if (!(Test-Path "certs\webrtc-dev.pfx")) {
    $issues += "缺失证书文件"
}

# 检查 Docker Compose
if (Test-Path "docker-compose.yml") {
    $content = Get-Content "docker-compose.yml" -Raw
    if ($content -notmatch "https://\+:5001") {
        $issues += "Docker Compose 缺失 HTTPS 配置"
    }
    if ($content -notmatch '"5001:5001"') {
        $issues += "Docker Compose 缺失 HTTPS 端口映射"
    }
} else {
    $issues += "缺失 docker-compose.yml"
}

# 报告结果
if ($issues.Count -eq 0) {
    Write-Host "✅ HTTPS 配置检查通过!" -ForegroundColor Green
    Write-Host "🌐 访问地址: https://localhost:5001" -ForegroundColor Cyan
} else {
    Write-Host "❌ 发现 $($issues.Count) 个问题:" -ForegroundColor Red
    foreach ($issue in $issues) {
        Write-Host "  • $issue" -ForegroundColor Yellow
    }
    Write-Host ""
    Write-Host "🔧 修复建议:" -ForegroundColor Blue
    Write-Host "  .\scripts\validate-https-config.ps1 -Fix" -ForegroundColor Cyan
} 